<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="generator" content="VuePress 2.0.0-beta.60">
    <script>
      (function() {
        const userMode = localStorage.getItem('vuepress-reco-color-scheme') || 'auto';
        const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;

        if (userMode === 'dark' || (userMode === 'auto' && systemDarkMode)) {
          document.documentElement.classList.toggle('dark', true);
        }
      })();
    </script>
    <title>Docker 图文 | 阿派 | Apai Blog</title><meta name="description" content="Just playing around">
    <link rel="modulepreload" href="/assets/app-8a43a0f0.js"><link rel="modulepreload" href="/assets/framework-e1bed10d.js"><link rel="modulepreload" href="/assets/Docker.html-51026828.js"><link rel="modulepreload" href="/assets/Docker.html-14746447.js"><link rel="prefetch" href="/assets/index.html-ef2f4f01.js" as="script"><link rel="prefetch" href="/assets/index.html-1013d654.js" as="script"><link rel="prefetch" href="/assets/index.html-a146dedc.js" as="script"><link rel="prefetch" href="/assets/index.html-f4b2eaea.js" as="script"><link rel="prefetch" href="/assets/index.html-e3ed352e.js" as="script"><link rel="prefetch" href="/assets/index.html-42ce2ab9.js" as="script"><link rel="prefetch" href="/assets/index.html-ec24ec9e.js" as="script"><link rel="prefetch" href="/assets/index.html-d3d8d7ce.js" as="script"><link rel="prefetch" href="/assets/index.html-9faf073b.js" as="script"><link rel="prefetch" href="/assets/index.html-9364b7dd.js" as="script"><link rel="prefetch" href="/assets/index.html-fc0fb462.js" as="script"><link rel="prefetch" href="/assets/index.html-603c6c19.js" as="script"><link rel="prefetch" href="/assets/index.html-0349deb8.js" as="script"><link rel="prefetch" href="/assets/index.html-09405a87.js" as="script"><link rel="prefetch" href="/assets/index.html-91577c59.js" as="script"><link rel="prefetch" href="/assets/index.html-552ae255.js" as="script"><link rel="prefetch" href="/assets/index.html-424369c4.js" as="script"><link rel="prefetch" href="/assets/index.html-1dfc0069.js" as="script"><link rel="prefetch" href="/assets/index.html-ec62f595.js" as="script"><link rel="prefetch" href="/assets/index.html-4621ef22.js" as="script"><link rel="prefetch" href="/assets/index.html-e189ec13.js" as="script"><link rel="prefetch" href="/assets/index.html-b424a45b.js" as="script"><link rel="prefetch" href="/assets/index.html-623952a8.js" as="script"><link rel="prefetch" href="/assets/index.html-cedcb7c8.js" as="script"><link rel="prefetch" href="/assets/index.html-07f61d2f.js" as="script"><link rel="prefetch" href="/assets/index.html-9ef01f1e.js" as="script"><link rel="prefetch" href="/assets/index.html-dfa6d19f.js" as="script"><link rel="prefetch" href="/assets/index.html-23dd0955.js" as="script"><link rel="prefetch" href="/assets/index.html-1e7a4ff3.js" as="script"><link rel="prefetch" href="/assets/index.html-e12f154a.js" as="script"><link rel="prefetch" href="/assets/index.html-30de2d02.js" as="script"><link rel="prefetch" href="/assets/index.html-6a244983.js" as="script"><link rel="prefetch" href="/assets/index.html-8900b10e.js" as="script"><link rel="prefetch" href="/assets/index.html-b3210461.js" as="script"><link rel="prefetch" href="/assets/biaoqian-fenlei-moban.html-2db9524d.js" as="script"><link rel="prefetch" href="/assets/MuBan-Apai.html-5af383c8.js" as="script"><link rel="prefetch" href="/assets/guide.html-5aaed80e.js" as="script"><link rel="prefetch" href="/assets/Lu-aboutMe.html-82ee5401.js" as="script"><link rel="prefetch" href="/assets/kaishi.html-9d8493a0.js" as="script"><link rel="prefetch" href="/assets/Hobby-SheYing.html-3ac28a1b.js" as="script"><link rel="prefetch" href="/assets/Lu-aboutMe.html-96d10c31.js" as="script"><link rel="prefetch" href="/assets/Work-MaYun.html-5e497e8c.js" as="script"><link rel="prefetch" href="/assets/Java-basics.html-4a44925e.js" as="script"><link rel="prefetch" href="/assets/JavaAPI.html-ae8a1843.js" as="script"><link rel="prefetch" href="/assets/JavaBiKeng04.html-c9e75b16.js" as="script"><link rel="prefetch" href="/assets/JavaGongNeng03.html-6ca97faf.js" as="script"><link rel="prefetch" href="/assets/JavaJinJie02.html-eaabb81d.js" as="script"><link rel="prefetch" href="/assets/JavaMyUtil.html-e2cff404.js" as="script"><link rel="prefetch" href="/assets/MyBatisPlus.html-b608a85b.js" as="script"><link rel="prefetch" href="/assets/MySql.html-4bcdc408.js" as="script"><link rel="prefetch" href="/assets/MySqlFunction.html-23affe6f.js" as="script"><link rel="prefetch" href="/assets/RabbitMQ.html-2cc19b22.js" as="script"><link rel="prefetch" href="/assets/Redis.html-f7a014e9.js" as="script"><link rel="prefetch" href="/assets/ShiWuAffair.html-33f5c0c4.js" as="script"><link rel="prefetch" href="/assets/Spring.html-628746d6.js" as="script"><link rel="prefetch" href="/assets/SpringConfig.html-49f3c621.js" as="script"><link rel="prefetch" href="/assets/SpringPeiZhi.html-ac6df88a.js" as="script"><link rel="prefetch" href="/assets/SpringSecurity.html-057633f1.js" as="script"><link rel="prefetch" href="/assets/WebSocket.html-57d6fc97.js" as="script"><link rel="prefetch" href="/assets/DockerCompose.html-98ad6b52.js" as="script"><link rel="prefetch" href="/assets/Linux.html-43351365.js" as="script"><link rel="prefetch" href="/assets/Nginx.html-f1276de6.js" as="script"><link rel="prefetch" href="/assets/RabbitMQ_COPY.html-5cdb6370.js" as="script"><link rel="prefetch" href="/assets/Redis_COPY.html-486e1d26.js" as="script"><link rel="prefetch" href="/assets/Redis_CRUD.html-47e0af0f.js" as="script"><link rel="prefetch" href="/assets/BatJiaoBen.html-d2d2666a.js" as="script"><link rel="prefetch" href="/assets/DmShengChen.html-bb069d8e.js" as="script"><link rel="prefetch" href="/assets/EasyExcel.html-b1eb613d.js" as="script"><link rel="prefetch" href="/assets/GitLu.html-eae89aa5.js" as="script"><link rel="prefetch" href="/assets/JavaKaiFa.html-4fbb86cc.js" as="script"><link rel="prefetch" href="/assets/JSR303.html-b976b418.js" as="script"><link rel="prefetch" href="/assets/MinIO.html-5e3d4702.js" as="script"><link rel="prefetch" href="/assets/ShardingJDBC.html-d0f811b3.js" as="script"><link rel="prefetch" href="/assets/Swagger.html-bb111a21.js" as="script"><link rel="prefetch" href="/assets/Vuepress.html-994cf672.js" as="script"><link rel="prefetch" href="/assets/Angular.html-3115afab.js" as="script"><link rel="prefetch" href="/assets/ElementUI.html-35bc6477.js" as="script"><link rel="prefetch" href="/assets/Html-Js.html-015f1806.js" as="script"><link rel="prefetch" href="/assets/Vue-basics.html-a64846f4.js" as="script"><link rel="prefetch" href="/assets/Vue3_group.html-f53be77f.js" as="script"><link rel="prefetch" href="/assets/Vue3_option.html-19f76b9e.js" as="script"><link rel="prefetch" href="/assets/ApifoxAPIceshi.html-19cd8153.js" as="script"><link rel="prefetch" href="/assets/PDManeryuanshujianmo.html-f6fa9d9e.js" as="script"><link rel="prefetch" href="/assets/OCRwenzishibie.html-11fc474d.js" as="script"><link rel="prefetch" href="/assets/EasyExcelbiaogeku.html-30777927.js" as="script"><link rel="prefetch" href="/assets/Javadaimashengchengqi.html-cf566ce0.js" as="script"><link rel="prefetch" href="/assets/JDKshuangbanben.html-1f259d3b.js" as="script"><link rel="prefetch" href="/assets/JSR303canshuxiaoyan.html-78322130.js" as="script"><link rel="prefetch" href="/assets/Mail  youjian.html-7e3a0f69.js" as="script"><link rel="prefetch" href="/assets/MyBatisPlusxiangjie.html-0168c152.js" as="script"><link rel="prefetch" href="/assets/MySQLzhucongfuzhi.html-7a4739e8.js" as="script"><link rel="prefetch" href="/assets/Redis-API.html-f488940c.js" as="script"><link rel="prefetch" href="/assets/SpringBootshiwu.html-c07a3864.js" as="script"><link rel="prefetch" href="/assets/SpringBootduxiefenli.html-f0993780.js" as="script"><link rel="prefetch" href="/assets/Springguolvqihelanjieqi.html-78feb321.js" as="script"><link rel="prefetch" href="/assets/WebSocket.html-caecf367.js" as="script"><link rel="prefetch" href="/assets/quanjuyichang-JSR303.html-add01eff.js" as="script"><link rel="prefetch" href="/assets/Dockeryuanchengfangwenbushu.html-7dc4f8d3.js" as="script"><link rel="prefetch" href="/assets/Nginxfanxiangdaili.html-42533685.js" as="script"><link rel="prefetch" href="/assets/Apai-SheYingOne.html-143bc574.js" as="script"><link rel="prefetch" href="/assets/Apai-Year.html-b713587f.js" as="script"><link rel="prefetch" href="/assets/My2305.html-b224c5e2.js" as="script"><link rel="prefetch" href="/assets/My2306.html-94838726.js" as="script"><link rel="prefetch" href="/assets/My2307.html-df2118c4.js" as="script"><link rel="prefetch" href="/assets/My2308.html-396c79bc.js" as="script"><link rel="prefetch" href="/assets/My2309.html-1ebdc4bb.js" as="script"><link rel="prefetch" href="/assets/My2310.html-d4ffbd04.js" as="script"><link rel="prefetch" href="/assets/My2311.html-30f23133.js" as="script"><link rel="prefetch" href="/assets/My2312.html-2da62191.js" as="script"><link rel="prefetch" href="/assets/Yi-HuBei.html-90d02bf7.js" as="script"><link rel="prefetch" href="/assets/Yi-ZhuHai.html-e202f6fb.js" as="script"><link rel="prefetch" href="/assets/Apache ECharts tubiao.html-6d4a4703.js" as="script"><link rel="prefetch" href="/assets/Vue3 zuheshi API.html-9fe2887f.js" as="script"><link rel="prefetch" href="/assets/Vue3 xuanxiangshi API.html-d584c181.js" as="script"><link rel="prefetch" href="/assets/Vue3-i18n-guojihuachajian.html-16f6e650.js" as="script"><link rel="prefetch" href="/assets/Batpichulijiaoben.html-307223b0.js" as="script"><link rel="prefetch" href="/assets/Gitgongzuoliu.html-fa6e129f.js" as="script"><link rel="prefetch" href="/assets/Typoratuchuang.html-22c57156.js" as="script"><link rel="prefetch" href="/assets/Vuepress.html-df146bdb.js" as="script"><link rel="prefetch" href="/assets/My2401.html-49f6440f.js" as="script"><link rel="prefetch" href="/assets/My2402.html-950d4e85.js" as="script"><link rel="prefetch" href="/assets/shenhai-0509.html-2007281b.js" as="script"><link rel="prefetch" href="/assets/zhuhaixing.html-17db8380.js" as="script"><link rel="prefetch" href="/assets/404.html-f9875e7b.js" as="script"><link rel="prefetch" href="/assets/index.html-40bced6f.js" as="script"><link rel="prefetch" href="/assets/index.html-3c78780e.js" as="script"><link rel="prefetch" href="/assets/index.html-ef51ba1b.js" as="script"><link rel="prefetch" href="/assets/index.html-bdec80a5.js" as="script"><link rel="prefetch" href="/assets/index.html-3b5427f8.js" as="script"><link rel="prefetch" href="/assets/index.html-cbd49540.js" as="script"><link rel="prefetch" href="/assets/index.html-b0b97c81.js" as="script"><link rel="prefetch" href="/assets/index.html-2793d245.js" as="script"><link rel="prefetch" href="/assets/index.html-71d9a5d9.js" as="script"><link rel="prefetch" href="/assets/index.html-4e7d77cd.js" as="script"><link rel="prefetch" href="/assets/index.html-aeace11a.js" as="script"><link rel="prefetch" href="/assets/index.html-c62ed802.js" as="script"><link rel="prefetch" href="/assets/index.html-e640d31f.js" as="script"><link rel="prefetch" href="/assets/index.html-48e1c605.js" as="script"><link rel="prefetch" href="/assets/index.html-385dcb56.js" as="script"><link rel="prefetch" href="/assets/index.html-1bb1a523.js" as="script"><link rel="prefetch" href="/assets/index.html-1ed80e8d.js" as="script"><link rel="prefetch" href="/assets/index.html-2c154a45.js" as="script"><link rel="prefetch" href="/assets/index.html-3e93d436.js" as="script"><link rel="prefetch" href="/assets/index.html-2a93e2c9.js" as="script"><link rel="prefetch" href="/assets/index.html-cff07ba3.js" as="script"><link rel="prefetch" href="/assets/index.html-7ec32a34.js" as="script"><link rel="prefetch" href="/assets/index.html-ddb40108.js" as="script"><link rel="prefetch" href="/assets/index.html-40ab6c4f.js" as="script"><link rel="prefetch" href="/assets/index.html-47e4ee8b.js" as="script"><link rel="prefetch" href="/assets/index.html-c15250e1.js" as="script"><link rel="prefetch" href="/assets/index.html-fb2ea2e4.js" as="script"><link rel="prefetch" href="/assets/index.html-d7e5408a.js" as="script"><link rel="prefetch" href="/assets/index.html-a38055d0.js" as="script"><link rel="prefetch" href="/assets/index.html-be4e50cb.js" as="script"><link rel="prefetch" href="/assets/index.html-660e4bef.js" as="script"><link rel="prefetch" href="/assets/index.html-98aa61ea.js" as="script"><link rel="prefetch" href="/assets/index.html-a6b7472f.js" as="script"><link rel="prefetch" href="/assets/index.html-ab78917a.js" as="script"><link rel="prefetch" href="/assets/biaoqian-fenlei-moban.html-f2c6c309.js" as="script"><link rel="prefetch" href="/assets/MuBan-Apai.html-5714876d.js" as="script"><link rel="prefetch" href="/assets/guide.html-9a89b22b.js" as="script"><link rel="prefetch" href="/assets/Lu-aboutMe.html-f8203e0a.js" as="script"><link rel="prefetch" href="/assets/kaishi.html-4ff9d0f3.js" as="script"><link rel="prefetch" href="/assets/Hobby-SheYing.html-e1ab7a00.js" as="script"><link rel="prefetch" href="/assets/Lu-aboutMe.html-4b735204.js" as="script"><link rel="prefetch" href="/assets/Work-MaYun.html-a185f330.js" as="script"><link rel="prefetch" href="/assets/Java-basics.html-c0d3a063.js" as="script"><link rel="prefetch" href="/assets/JavaAPI.html-f75cbb54.js" as="script"><link rel="prefetch" href="/assets/JavaBiKeng04.html-d2fc755d.js" as="script"><link rel="prefetch" href="/assets/JavaGongNeng03.html-c51a3060.js" as="script"><link rel="prefetch" href="/assets/JavaJinJie02.html-e5a66660.js" as="script"><link rel="prefetch" href="/assets/JavaMyUtil.html-6e16ee98.js" as="script"><link rel="prefetch" href="/assets/MyBatisPlus.html-1cafeb7e.js" as="script"><link rel="prefetch" href="/assets/MySql.html-5adc8c86.js" as="script"><link rel="prefetch" href="/assets/MySqlFunction.html-2c432c8c.js" as="script"><link rel="prefetch" href="/assets/RabbitMQ.html-d771200f.js" as="script"><link rel="prefetch" href="/assets/Redis.html-aa5c160a.js" as="script"><link rel="prefetch" href="/assets/ShiWuAffair.html-ce7fc825.js" as="script"><link rel="prefetch" href="/assets/Spring.html-3d622ed7.js" as="script"><link rel="prefetch" href="/assets/SpringConfig.html-6fe667f9.js" as="script"><link rel="prefetch" href="/assets/SpringPeiZhi.html-96b777da.js" as="script"><link rel="prefetch" href="/assets/SpringSecurity.html-fe792e2f.js" as="script"><link rel="prefetch" href="/assets/WebSocket.html-7fd7be86.js" as="script"><link rel="prefetch" href="/assets/DockerCompose.html-f6ef44c4.js" as="script"><link rel="prefetch" href="/assets/Linux.html-a1058183.js" as="script"><link rel="prefetch" href="/assets/Nginx.html-bf694d87.js" as="script"><link rel="prefetch" href="/assets/RabbitMQ_COPY.html-1e53d902.js" as="script"><link rel="prefetch" href="/assets/Redis_COPY.html-ef853ef3.js" as="script"><link rel="prefetch" href="/assets/Redis_CRUD.html-7a4bb7d5.js" as="script"><link rel="prefetch" href="/assets/BatJiaoBen.html-20ec59d7.js" as="script"><link rel="prefetch" href="/assets/DmShengChen.html-92a2db1f.js" as="script"><link rel="prefetch" href="/assets/EasyExcel.html-ac2c3493.js" as="script"><link rel="prefetch" href="/assets/GitLu.html-27823973.js" as="script"><link rel="prefetch" href="/assets/JavaKaiFa.html-ff11bb84.js" as="script"><link rel="prefetch" href="/assets/JSR303.html-0c745945.js" as="script"><link rel="prefetch" href="/assets/MinIO.html-958125dd.js" as="script"><link rel="prefetch" href="/assets/ShardingJDBC.html-ce0afe07.js" as="script"><link rel="prefetch" href="/assets/Swagger.html-9c9fb3be.js" as="script"><link rel="prefetch" href="/assets/Vuepress.html-4e07419a.js" as="script"><link rel="prefetch" href="/assets/Angular.html-3e716bd5.js" as="script"><link rel="prefetch" href="/assets/ElementUI.html-70835a6c.js" as="script"><link rel="prefetch" href="/assets/Html-Js.html-848bb521.js" as="script"><link rel="prefetch" href="/assets/Vue-basics.html-772005d8.js" as="script"><link rel="prefetch" href="/assets/Vue3_group.html-69369e84.js" as="script"><link rel="prefetch" href="/assets/Vue3_option.html-37ac05d4.js" as="script"><link rel="prefetch" href="/assets/ApifoxAPIceshi.html-0bcb1468.js" as="script"><link rel="prefetch" href="/assets/PDManeryuanshujianmo.html-4c377e02.js" as="script"><link rel="prefetch" href="/assets/OCRwenzishibie.html-b4248616.js" as="script"><link rel="prefetch" href="/assets/EasyExcelbiaogeku.html-511b0f0b.js" as="script"><link rel="prefetch" href="/assets/Javadaimashengchengqi.html-33991c95.js" as="script"><link rel="prefetch" href="/assets/JDKshuangbanben.html-8bba14d4.js" as="script"><link rel="prefetch" href="/assets/JSR303canshuxiaoyan.html-7d12c0ef.js" as="script"><link rel="prefetch" href="/assets/Mail  youjian.html-d520132f.js" as="script"><link rel="prefetch" href="/assets/MyBatisPlusxiangjie.html-94d1940a.js" as="script"><link rel="prefetch" href="/assets/MySQLzhucongfuzhi.html-bf156f04.js" as="script"><link rel="prefetch" href="/assets/Redis-API.html-534cd405.js" as="script"><link rel="prefetch" href="/assets/SpringBootshiwu.html-a83407ed.js" as="script"><link rel="prefetch" href="/assets/SpringBootduxiefenli.html-e50eba32.js" as="script"><link rel="prefetch" href="/assets/Springguolvqihelanjieqi.html-b7cdfd68.js" as="script"><link rel="prefetch" href="/assets/WebSocket.html-7c2b5253.js" as="script"><link rel="prefetch" href="/assets/quanjuyichang-JSR303.html-1f70d8b7.js" as="script"><link rel="prefetch" href="/assets/Dockeryuanchengfangwenbushu.html-f42be316.js" as="script"><link rel="prefetch" href="/assets/Nginxfanxiangdaili.html-a98dc972.js" as="script"><link rel="prefetch" href="/assets/Apai-SheYingOne.html-b5b7ae7c.js" as="script"><link rel="prefetch" href="/assets/Apai-Year.html-ce260a3f.js" as="script"><link rel="prefetch" href="/assets/My2305.html-8daa1c69.js" as="script"><link rel="prefetch" href="/assets/My2306.html-893e00c1.js" as="script"><link rel="prefetch" href="/assets/My2307.html-e78450ff.js" as="script"><link rel="prefetch" href="/assets/My2308.html-0e38205b.js" as="script"><link rel="prefetch" href="/assets/My2309.html-06a48ebc.js" as="script"><link rel="prefetch" href="/assets/My2310.html-59afa2c3.js" as="script"><link rel="prefetch" href="/assets/My2311.html-b634eab1.js" as="script"><link rel="prefetch" href="/assets/My2312.html-aafaa08a.js" as="script"><link rel="prefetch" href="/assets/Yi-HuBei.html-61c8ef5d.js" as="script"><link rel="prefetch" href="/assets/Yi-ZhuHai.html-26a46f60.js" as="script"><link rel="prefetch" href="/assets/Apache ECharts tubiao.html-e9cc0012.js" as="script"><link rel="prefetch" href="/assets/Vue3 zuheshi API.html-11ae0fbc.js" as="script"><link rel="prefetch" href="/assets/Vue3 xuanxiangshi API.html-ce744458.js" as="script"><link rel="prefetch" href="/assets/Vue3-i18n-guojihuachajian.html-1fa338e8.js" as="script"><link rel="prefetch" href="/assets/Batpichulijiaoben.html-06ab27bc.js" as="script"><link rel="prefetch" href="/assets/Gitgongzuoliu.html-b1e45d5c.js" as="script"><link rel="prefetch" href="/assets/Typoratuchuang.html-cb5c9b25.js" as="script"><link rel="prefetch" href="/assets/Vuepress.html-c36453a2.js" as="script"><link rel="prefetch" href="/assets/My2401.html-9b16cb88.js" as="script"><link rel="prefetch" href="/assets/My2402.html-3ade37a1.js" as="script"><link rel="prefetch" href="/assets/shenhai-0509.html-648d7d95.js" as="script"><link rel="prefetch" href="/assets/zhuhaixing.html-7d486783.js" as="script"><link rel="prefetch" href="/assets/404.html-7c90b0cc.js" as="script"><link rel="prefetch" href="/assets/reco-valine-a0c1af1f.js" as="script">
    <link rel="preload" href="/assets/style-8a0f09c6.css" as="style"><link rel="stylesheet" href="/assets/style-8a0f09c6.css">
  </head>
  <body>
    <div id="app"><!--[--><div class="theme-container"><div class="common-wrapper series--no show-catalog"><div><header class="navbar-container"><!--[--><div class="site-brand nav-item"><img class="logo" src="/logo.png" alt="阿派 | Apai Blog"><a href="/" class="site-name can-hide">阿派 | Apai Blog</a></div><div class="nav-item navbar-links-wrapper" style=""><form class="search-box" role="search"><input type="search" autocomplete="off" spellcheck="false" value><!----></form><nav class="navbar-links"><!--[--><div class="navbar-links__item"><a href="/" class="link router-link-active" aria-label="Home"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Home<!--]--></span></span><!--[--><!--]--></a></div><div class="navbar-links__item"><a href="/categories/Java/1/" class="link" aria-label="分类组"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->分类组<!--]--></span></span><!--[--><!--]--></a></div><div class="navbar-links__item"><a href="/tags/Rests/1/" class="link" aria-label="标签组"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->标签组<!--]--></span></span><!--[--><!--]--></a></div><div class="navbar-links__item"><div class="dropdown-link"><button class="dropdown-link__title" type="button" aria-label="文档组"><span class="xicon-container left title"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->文档组<!--]--></span></span><span class="arrow down"></span></button><button class="dropdown-link--mobile__title" type="button" aria-label="文档组"><span class="title"><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->文档组<!--]--></span></span></span><span class="right arrow"></span></button><ul style="display:none;" class="dropdown-link__container"><!--[--><li class="dropdown-link__item"><a href="/docs/Web-develop/Html-Js" class="link" aria-label="Web-开发"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Web-开发<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Java-develop/JavaMyUtil" class="link" aria-label="Java-开发"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Java-开发<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Linux-develop/Linux" class="link" aria-label="Linux-系统"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Linux-系统<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Rests-docs/Vuepress" class="link" aria-label="Apai-其他"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Apai-其他<!--]--></span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-links__item"><div class="dropdown-link"><button class="dropdown-link__title" type="button" aria-label="花圃里"><span class="xicon-container left title"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->花圃里<!--]--></span></span><span class="arrow down"></span></button><button class="dropdown-link--mobile__title" type="button" aria-label="花圃里"><span class="title"><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->花圃里<!--]--></span></span></span><span class="right arrow"></span></button><ul style="display:none;" class="dropdown-link__container"><!--[--><li class="dropdown-link__item"><a href="/docs/Apai-MyRecord/My-2023/My2307" class="link" aria-label="2023-花开万里"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->2023-花开万里<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Apai-MyRecord/My-2024/My2401" class="link" aria-label="2024-随心而来"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->2024-随心而来<!--]--></span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-links__item"><a href="/docs/Apai-AboutMe/Lu-aboutMe" class="link" aria-label="关于我"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->关于我<!--]--></span></span><!--[--><!--]--></a></div><!--]--></nav><span class="xicon-container btn-toggle-dark-mode btn--dark-mode"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" style="width:20px;height:20px;font-size:20px;color:inherit;"><path d="M15 2h2v3h-2z" fill="currentColor"></path><path d="M27 15h3v2h-3z" fill="currentColor"></path><path d="M15 27h2v3h-2z" fill="currentColor"></path><path d="M2 15h3v2H2z" fill="currentColor"></path><path d="M5.45 6.884l1.414-1.415l2.121 2.122l-1.414 1.414z" fill="currentColor"></path><path d="M23 7.58l2.121-2.12l1.414 1.414l-2.121 2.121z" fill="currentColor"></path><path d="M23.002 24.416l1.415-1.414l2.12 2.122l-1.413 1.414z" fill="currentColor"></path><path d="M5.47 25.13L7.59 23L9 24.42l-2.12 2.12l-1.41-1.41z" fill="currentColor"></path><path d="M16 8a8 8 0 1 0 8 8a8 8 0 0 0-8-8zm0 14a6 6 0 0 1 0-12z" fill="currentColor"></path></svg></span><span class="xicon-container btn-toggle-menus"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" style="width:20px;height:20px;font-size:20px;color:inherit;"><circle cx="16" cy="8" r="2" fill="currentColor"></circle><circle cx="16" cy="16" r="2" fill="currentColor"></circle><circle cx="16" cy="24" r="2" fill="currentColor"></circle></svg></span></div><!--]--></header><div class="mobile-menus-container"><nav class="navbar-links mobile"><!--[--><div class="navbar-links__item"><a href="/" class="link router-link-active" aria-label="Home"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Home<!--]--></span></span><!--[--><!--]--></a></div><div class="navbar-links__item"><a href="/categories/Java/1/" class="link" aria-label="分类组"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->分类组<!--]--></span></span><!--[--><!--]--></a></div><div class="navbar-links__item"><a href="/tags/Rests/1/" class="link" aria-label="标签组"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->标签组<!--]--></span></span><!--[--><!--]--></a></div><div class="navbar-links__item"><div class="dropdown-link"><button class="dropdown-link__title" type="button" aria-label="文档组"><span class="xicon-container left title"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->文档组<!--]--></span></span><span class="arrow down"></span></button><button class="dropdown-link--mobile__title" type="button" aria-label="文档组"><span class="title"><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->文档组<!--]--></span></span></span><span class="right arrow"></span></button><ul style="display:none;" class="dropdown-link__container"><!--[--><li class="dropdown-link__item"><a href="/docs/Web-develop/Html-Js" class="link" aria-label="Web-开发"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Web-开发<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Java-develop/JavaMyUtil" class="link" aria-label="Java-开发"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Java-开发<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Linux-develop/Linux" class="link" aria-label="Linux-系统"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Linux-系统<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Rests-docs/Vuepress" class="link" aria-label="Apai-其他"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Apai-其他<!--]--></span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-links__item"><div class="dropdown-link"><button class="dropdown-link__title" type="button" aria-label="花圃里"><span class="xicon-container left title"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->花圃里<!--]--></span></span><span class="arrow down"></span></button><button class="dropdown-link--mobile__title" type="button" aria-label="花圃里"><span class="title"><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->花圃里<!--]--></span></span></span><span class="right arrow"></span></button><ul style="display:none;" class="dropdown-link__container"><!--[--><li class="dropdown-link__item"><a href="/docs/Apai-MyRecord/My-2023/My2307" class="link" aria-label="2023-花开万里"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->2023-花开万里<!--]--></span></span><!--[--><!--]--></a></li><li class="dropdown-link__item"><a href="/docs/Apai-MyRecord/My-2024/My2401" class="link" aria-label="2024-随心而来"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->2024-随心而来<!--]--></span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-links__item"><a href="/docs/Apai-AboutMe/Lu-aboutMe" class="link" aria-label="关于我"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->关于我<!--]--></span></span><!--[--><!--]--></a></div><!--]--></nav><div class="appearance"><span>Appearance</span><span class="xicon-container btn-toggle-dark-mode"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" style="width:20px;height:20px;font-size:20px;color:inherit;"><path d="M15 2h2v3h-2z" fill="currentColor"></path><path d="M27 15h3v2h-3z" fill="currentColor"></path><path d="M15 27h2v3h-2z" fill="currentColor"></path><path d="M2 15h3v2H2z" fill="currentColor"></path><path d="M5.45 6.884l1.414-1.415l2.121 2.122l-1.414 1.414z" fill="currentColor"></path><path d="M23 7.58l2.121-2.12l1.414 1.414l-2.121 2.121z" fill="currentColor"></path><path d="M23.002 24.416l1.415-1.414l2.12 2.122l-1.413 1.414z" fill="currentColor"></path><path d="M5.47 25.13L7.59 23L9 24.42l-2.12 2.12l-1.41-1.41z" fill="currentColor"></path><path d="M16 8a8 8 0 1 0 8 8a8 8 0 0 0-8-8zm0 14a6 6 0 0 1 0-12z" fill="currentColor"></path></svg></span></div></div><div class="series-mask"></div><aside class="series-container"><div class="site-brand"><img class="logo" src="/logo.png" alt="阿派 | Apai Blog"><a href="/" class="site-name can-hide">阿派 | Apai Blog</a></div><!--[--><!--]--></aside><!--[--><main class="page-container"><h1 class="page-title">Docker 图文</h1><div class="page-info"><span class="xicon-container left"><!--[--><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="xicon-icon" style="width:18px;height:18px;font-size:18px;color:inherit;"><path d="M16 4a5 5 0 1 1-5 5a5 5 0 0 1 5-5m0-2a7 7 0 1 0 7 7a7 7 0 0 0-7-7z" fill="currentColor"></path><path d="M26 30h-2v-5a5 5 0 0 0-5-5h-6a5 5 0 0 0-5 5v5H6v-5a7 7 0 0 1 7-7h6a7 7 0 0 1 7 7z" fill="currentColor"></path></svg><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->LuisApai<!--]--></span></span><span class="xicon-container left"><!--[--><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="xicon-icon" style="width:18px;height:18px;font-size:18px;color:inherit;"><path d="M26 4h-4V2h-2v2h-8V2h-2v2H6c-1.1 0-2 .9-2 2v20c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 22H6V12h20v14zm0-16H6V6h4v2h2V6h8v2h2V6h4v4z" fill="currentColor"></path></svg><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->2023/04/25<!--]--></span></span><span class="xicon-container left"><!--[--><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="xicon-icon" style="width:18px;height:18px;font-size:18px;color:inherit;"><path d="M11.17 6l3.42 3.41l.58.59H28v16H4V6h7.17m0-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2H16l-3.41-3.41A2 2 0 0 0 11.17 4z" fill="currentColor"></path></svg><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Linux<!--]--></span></span><span class="xicon-container left"><!--[--><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="xicon-icon" style="width:18px;height:18px;font-size:18px;color:inherit;"><path d="M10 14a4 4 0 1 1 4-4a4.005 4.005 0 0 1-4 4zm0-6a2 2 0 1 0 1.998 2.004A2.002 2.002 0 0 0 10 8z" fill="currentColor"></path><path d="M16.644 29.415L2.586 15.354A2 2 0 0 1 2 13.941V4a2 2 0 0 1 2-2h9.941a2 2 0 0 1 1.414.586l14.06 14.058a2 2 0 0 1 0 2.828l-9.943 9.943a2 2 0 0 1-2.829 0zM4 4v9.942L18.058 28L28 18.058L13.942 4z" fill="currentColor"></path></svg><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker容器<!--]--></span></span><!----></div><div class="theme-reco-default-content"><div><h2 id="docker-基础概念" tabindex="-1"><a class="header-anchor" href="#docker-基础概念" aria-hidden="true">#</a> Docker 基础概念</h2><p>Docker 是一个<strong>开源的平台</strong>，我们<strong>可以用 Docker 来开发、部署和运行我们的应用程序</strong>。Docker 可以帮助我们<strong>将应用程序和底层基础设施进行分离，以帮助我们更快的实现交付</strong>。通过 Docker 技术，我们可以像管理我们的应用一样管理我们的基础设施（比如操作系统、依赖的开发包等）。通过 Docker 技术，可以精简我们的整个开发和交互流程。</p><h3 id="docker-镜像" tabindex="-1"><a class="header-anchor" href="#docker-镜像" aria-hidden="true">#</a> Docker 镜像</h3><p>在谈及 Docker 镜像之前，需知道操作系统分为 <strong>内核</strong> 和 <strong>用户空间</strong>。对于 <code>Linux</code> 而言，内核启动后，会挂载 <code>root</code> 文件系统为其提供用户空间支持。而 <strong>Docker 镜像</strong>（<code>Image</code>），就相当于是一个 <code>root</code> 文件系统。比如官方镜像 <code>ubuntu:18.04</code> 就包含了完整的一套 Ubuntu 18.04 最小系统的 <code>root</code> 文件系统。</p><p><strong>Docker 镜像是一个特殊的文件系统</strong>，除了提供容器运行时所需的程序、库、资源、配置等文件外，还包含了一些为运行时准备的一些配置参数（如匿名卷、环境变量、用户等）。镜像不包含任何动态数据，其内容在构建之后也不会被改变。</p><blockquote><p>分层存储</p></blockquote><p>刚才说道，镜像包含操作系统完整的 <code>root</code> 文件系统，其体积往往是庞大的，因此 Docker 在设计之初，就充分利用 Union FS 的技术，将其设计为分层存储的架构。所以严格来说，镜像并非是像一个 <code>ISO</code> 那样的打包文件，镜像只是一个虚拟的概念，其实际体现并非由一个文件组成，而是由一组文件系统组成，或者说，由多层文件系统联合组成。</p><p>镜像构建时，会一层层构建，前一层是后一层的基础。每一层构建完就不会再发生改变，后一层上的任何改变只发生在自己这一层。比如，删除前一层文件的操作，实际不是真的删除前一层的文件，而是仅在当前层标记为该文件已删除。在最终容器运行的时候，虽然不会看到这个文件，但是实际上该文件会一直跟随镜像。因此，在构建镜像的时候，需要额外小心，每一层尽量只包含该层需要添加的东西，任何额外的东西应该在该层构建结束前清理掉。</p><p>分层存储的特征还使得镜像的复用、定制变的更为容易。甚至可以用之前构建好的镜像作为基础层，然后进一步添加新的层，以定制自己所需的内容，构建新的镜像。</p><h3 id="docker-容器" tabindex="-1"><a class="header-anchor" href="#docker-容器" aria-hidden="true">#</a> Docker 容器</h3><p><strong>通过镜像运行的实例称之为容器</strong>，两者的关系就像是面向对象程序设计中的 <code>类</code> 和 <code>实例</code> 一样，镜像是静态的定义，容器是镜像运行时的实体。容器可以被创建、启动、停止、删除、暂停等。</p><p>Docker 利用容器来运行应用，每个容器都是相互隔离的、保证安全的平台。我们可以把容器看做是一个轻量级的Linux 运行环境。</p><p>容器的实质是进程，但与直接在宿主执行的进程不同，容器进程运行于属于自己的独立的命名空间。因此容器可以拥有自己的 <code>root</code> 文件系统、自己的网络配置、自己的进程空间，甚至自己的用户 ID 空间。容器内的进程是运行在一个隔离的环境里，使用起来，就好像是在一个独立于宿主的系统下操作一样。这种特性使得容器封装的应用比直接在宿主运行更加安全。也因为这种隔离的特性，很多人初学 Docker 时常常会混淆容器和虚拟机。</p><p>前小节中讲过镜像使用的是分层存储，容器也是如此。每一个容器运行时，是以镜像为基础层，在其上创建一个当前容器的存储层，我们可以称这个为容器运行时读写而准备的存储层为<strong>容器存储层</strong>。</p><p><img src="https://cdn.jsdelivr.net/gh/LuJunandapai/ApaiImage@main/MaYun-PicGo/166260036956133" alt="Docker 容器与镜像之间分层存储的比较">Docker 容器与镜像之间分层存储的比较</p><p>容器存储层的生存周期和容器一样，容器消亡时，容器存储层也随之消亡。因此，任何保存于容器存储层的信息都会随容器删除而丢失。</p><p>按照 Docker 最佳实践的要求，容器不应该向其存储层内写入任何数据，容器存储层要保持无状态化。所有的文件写入操作，都应该使用<a href="https://www.quanxiaoha.com/docker/docker-volume.html" target="_blank" rel="noopener noreferrer">数据卷（Volume）<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 、或者 绑定宿主目录，在这些位置的读写会跳过容器存储层，直接对宿主（或网络存储）发生读写，其性能和稳定性更高。</p><p>数据卷的生存周期独立于容器，容器消亡，数据卷不会消亡。因此，使用数据卷后，容器删除或者重新运行之后，数据却不会丢失。</p><h3 id="docker-仓库" tabindex="-1"><a class="header-anchor" href="#docker-仓库" aria-hidden="true">#</a> Docker 仓库</h3><p>Docker Repository 用于镜像的集中存储、分发的地方。有了它，镜像在构建完成后，在其他机器上就可以非常方便的下载使用这个镜像了。</p><p>一个 <strong>Docker Registry</strong> 中可以包含多个 <strong>仓库</strong>（<code>Repository</code>）；每个仓库可以包含多个 <strong>标签</strong>（<code>Tag</code>）；每个标签对应一个镜像。</p><p>通常，一个仓库会包含同一个软件不同版本的镜像，而标签就常用于对应该软件的各个版本。我们可以通过 <code>&lt;仓库名&gt;:&lt;标签&gt;</code> 的格式来指定具体是这个软件哪个版本的镜像。如果不给出标签，将以 <code>latest</code> 作为默认标签，表示最新的一个版本。</p><p>以 Ubuntu 镜像为例，<code>ubuntu</code> 是仓库的名字，其内包含有不同的版本标签，如，<code>16.04</code>, <code>18.04</code>。我们可以通过 <code>ubuntu:16.04</code>，或者 <code>ubuntu:18.04</code> 来具体指定所需哪个版本的镜像。如果忽略了标签，比如 <code>ubuntu</code>，那将视为 <code>ubuntu:latest</code>。</p><p>仓库名经常以 <em>两段式路径</em> 形式出现，比如 <code>jwilder/nginx-proxy</code>，前者往往意味着 Docker Registry 多用户环境下的用户名，后者则往往是对应的软件名。但这并非绝对，取决于所使用的具体 Docker Registry 的软件或服务。</p><blockquote><h4 id="公有仓库" tabindex="-1"><a class="header-anchor" href="#公有仓库" aria-hidden="true">#</a> 公有仓库</h4></blockquote><p>公有仓库是允许用户免费上传、下载的公开镜像服务。比如官方的 <a href="https://hub.docker.com/" target="_blank" rel="noopener noreferrer">Docker Hub<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> ，也是默认的 Docker Repository，里面拥有着大量的高质量镜像。但是国内访问它可能比较慢，国内的云服务商提供了针对 Docker Hub 的镜像服务（<code>Registry Mirror</code>），这些镜像服务被称为<strong>镜像加速器</strong>。国内常见有阿里云加速器、网易加速器、DaoCloud 加速器等。</p><p>本教程提供了阿里云加速器的配置方法，链接如下：</p><p><a href="https://www.quanxiaoha.com/docker/aliyun-docker-registry.html" target="_blank" rel="noopener noreferrer">Docker 配置阿里云镜像加速器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></p><blockquote><h4 id="私有仓库" tabindex="-1"><a class="header-anchor" href="#私有仓库" aria-hidden="true">#</a> 私有仓库</h4></blockquote><p>除了公有仓库外，用户还可以在本地搭建私有仓库。Docker 官方提供了 <a href="https://hub.docker.com/_/registry/" target="_blank" rel="noopener noreferrer">Docker Registry<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 镜像，可以直接使用做为私有 Registry 服务。</p><p>开源的 Docker Registry 镜像只提供了 <a href="https://docs.docker.com/registry/spec/api/" target="_blank" rel="noopener noreferrer">Docker Registry API<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 的服务端实现，足以支持 <code>docker</code> 命令，不影响使用。但不包含图形界面，以及镜像维护、用户管理、访问控制等高级功能。</p><p>除了官方的 Docker Registry 外，还有第三方软件实现了 Docker Registry API，甚至提供了用户界面以及一些高级功能。比如，Harbor 和 Sonatype Nexus。</p><h2 id="docker-环境安装" tabindex="-1"><a class="header-anchor" href="#docker-环境安装" aria-hidden="true">#</a> | -- Docker 环境安装</h2><ul><li><a href="https://www.quanxiaoha.com/docker/windows-install-docker.html" target="_blank" rel="noopener noreferrer">Windows 安装 Docker<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></li><li><a href="https://www.quanxiaoha.com/docker/macos-docker-install.html" target="_blank" rel="noopener noreferrer">MacOS 安装 Docker<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></li><li><a href="https://www.quanxiaoha.com/docker/centos-install-docker.html" target="_blank" rel="noopener noreferrer">CentOS 安装 Docker<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></li><li><a href="https://www.quanxiaoha.com/docker/ubuntu-install-docker.html" target="_blank" rel="noopener noreferrer">Ubuntu 安装 Docker<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></li><li><a href="https://www.quanxiaoha.com/docker/aliyun-docker-registry.html" target="_blank" rel="noopener noreferrer">Docker 镜像加速器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></li></ul><h2 id="windows-安装-docker" tabindex="-1"><a class="header-anchor" href="#windows-安装-docker" aria-hidden="true">#</a> Windows 安装 Docker</h2><h3 id="安装-docker-desktop" tabindex="-1"><a class="header-anchor" href="#安装-docker-desktop" aria-hidden="true">#</a> 安装 Docker Desktop</h3><p>1、访问 Docker Desktop 官方下载地址：https://www.docker.com/products/docker-desktop/ ， 选择对应平台的 Docker Desktop 安装包点击下载：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166253682548544" alt="点击下载 Windows 系统 Docker 安装包"></p><p>2、下载成功后，双击开始安装：windows 系统 docker 安装包</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166253658102062" alt="windows 系统 docker 安装包"></p><p>3、安装之前的相关配置：</p><ul><li>Use WSL 2 instead of Hyper-V (recommended) : 启用虚拟化，以 WSL 2 替代 Hyper-V;</li><li>Add shortcut to desktop : 安装成功后添加桌面快捷启动图标；</li></ul><p><strong>将两个选项都勾选上</strong>，然后点击【ok】,开始安装：Windows 安装 docker 第一步</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166253709621223" alt="Windows 安装 docker 第一步"></p><p>4、 安装成功后，点击【Close and restart】按钮重启系统：Windows 安装 Docker 完成</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166254286673183" alt="Windows 安装 Docker 完成"></p><p>5、重启系统成功后，会自动显示如下弹框，点击【Accept】按钮接受协议：接受 Docker 协议</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166254318532387" alt="接受 Docker 协议"></p><p>6、Docker 启动成功后，跳过引导介绍，看到下面界面表示 Docker 运行成功了：Docker Desktop 启动成功</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166254567195928" alt="Docker Desktop 启动成功"></p><h3 id="安装中你可能的问题" tabindex="-1"><a class="header-anchor" href="#安装中你可能的问题" aria-hidden="true">#</a> 安装中你可能的问题</h3><p>在 Docker Desktop 启动过程中，报错如下，导致启动失败：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>System.InvalidOperationException:
Failed to set version to docker-desktop: exit code: -1　
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/166254581034382" alt="启动 Docker Desktop 失败">启动 Docker Desktop 失败</p><blockquote><h4 id="解决方案" tabindex="-1"><a class="header-anchor" href="#解决方案" aria-hidden="true">#</a> 解决方案</h4></blockquote><p><strong>通过管理员权限运行 PowerShell</strong>, 执行如下命令：重启计算机，即可正常启动 Docker Desktop 。</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>netsh winsock reset
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="查看当前-docker-版本" tabindex="-1"><a class="header-anchor" href="#查看当前-docker-版本" aria-hidden="true">#</a> 查看当前 Docker 版本</h3><p>在 PowerShell 中执行如下命令，可打印 Docker 版本号：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker -v
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/166254629985470" alt="查看当前 Docker 版本号">查看当前 Docker 版本号</p><h3 id="验证-docker-desktop-正常" tabindex="-1"><a class="header-anchor" href="#验证-docker-desktop-正常" aria-hidden="true">#</a> 验证 Docker Desktop 正常</h3><p>在 PowerShell 中执行如下命令：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker run hello-world
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>若输出如下，则表示 Docker 安装成功，且能够正常工作：通过 Docker 执行 hello-world</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166254645945144" alt="通过 Docker 执行 hello-world"></p><p>打开 Docker Desktop 可查看到刚刚的 <code>hello-world</code> 镜像：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/166254705011789" alt="Docker Desktop 中查看 hello-world 镜像"></p><h2 id="centos-安装-docker" tabindex="-1"><a class="header-anchor" href="#centos-安装-docker" aria-hidden="true">#</a> CentOS 安装 Docker</h2><p>Docker可以运行在MAC、Windows、CentOS、UBUNTU等操作系统上，本课程基于CentOS 7 安装Docker。</p><p>官网：https://www.docker.com</p><div class="language-java line-numbers-mode" data-ext="java"><pre class="language-java"><code><span class="token comment">// 考虑到从 docker 官方的仓库下载 docker-ce 有时会比较慢，可以使用下述命令将下载网址改为华为的镜像服务器：</span>
sudo sed <span class="token operator">-</span>i &#39;s<span class="token operator">+</span>download<span class="token punctuation">.</span>docker<span class="token punctuation">.</span>com<span class="token operator">+</span>repo<span class="token punctuation">.</span>huaweicloud<span class="token punctuation">.</span>com<span class="token operator">/</span>docker<span class="token operator">-</span>ce<span class="token operator">+</span>&#39; <span class="token operator">/</span>etc<span class="token operator">/</span>yum<span class="token punctuation">.</span>repos<span class="token punctuation">.</span>d<span class="token operator">/</span>docker<span class="token operator">-</span>ce<span class="token punctuation">.</span>repo
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token comment"># yum 包更新到最新</span>
yum update <span class="token parameter variable">-y</span>    
<span class="token comment"># 安装需要的软件包</span>
yum <span class="token function">install</span> <span class="token parameter variable">-y</span> yum-utils device-mapper-persistent-data lvm2
<span class="token comment"># 设置yum源</span>
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
<span class="token comment"># 华为的镜像服务器 可提高下载速度</span>
<span class="token function">sudo</span> <span class="token function">sed</span> <span class="token parameter variable">-i</span> <span class="token string">&#39;s+download.docker.com+repo.huaweicloud.com/docker-ce+&#39;</span> /etc/yum.repos.d/docker-ce.repo
<span class="token comment"># 安装docker</span>
yum <span class="token function">install</span> <span class="token parameter variable">-y</span> docker-ce   
<span class="token comment"># 查看docker版本，验证是否验证成功</span>
<span class="token function">docker</span> <span class="token parameter variable">-v</span>        
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="docker-操作命令" tabindex="-1"><a class="header-anchor" href="#docker-操作命令" aria-hidden="true">#</a> | -- Docker 操作命令</h2><h2 id="docker-镜像-1" tabindex="-1"><a class="header-anchor" href="#docker-镜像-1" aria-hidden="true">#</a> Docker 镜像</h2><h3 id="docker-搜索镜像" tabindex="-1"><a class="header-anchor" href="#docker-搜索镜像" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-search-image.html" target="_blank" rel="noopener noreferrer">Docker 搜索镜像<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="search-命令" tabindex="-1"><a class="header-anchor" href="#search-命令" aria-hidden="true">#</a> search 命令</h4><p>在 Docker 中，通过如下命令搜索镜像：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> search <span class="token punctuation">[</span>option<span class="token punctuation">]</span> keyword
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>比如，你想搜索仓库中 <code>mysql</code> 相关的镜像，可以输入如下命令：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> search mysql
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165700112104243" alt="Docker 搜索镜像">Docker 搜索镜像</p><p>返回字段说明：</p><ul><li><strong>NAME</strong> : 镜像名称；</li><li><strong>DESCRIPTION</strong> : 镜像描述信息；</li><li><strong>STARS</strong> : 用户标星数；</li><li><strong>OFFICIAL</strong>: 是否为官方提供，<code>[OK]</code>表示为官方提供；</li></ul><h4 id="search-支持的参数" tabindex="-1"><a class="header-anchor" href="#search-支持的参数" aria-hidden="true">#</a> search 支持的参数</h4><p>命令行执行 <code>docker search --help</code>, 可以知道 <code>search</code> 命令支持的参数：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code>Usage:  <span class="token function">docker</span> search <span class="token punctuation">[</span>OPTIONS<span class="token punctuation">]</span> <span class="token environment constant">TERM</span>

Search the Docker Hub <span class="token keyword">for</span> images

Options:
  -f, <span class="token parameter variable">--filter</span> filter   Filter output based on conditions provided
      <span class="token parameter variable">--help</span>            Print usage
      <span class="token parameter variable">--limit</span> int       Max number of search results <span class="token punctuation">(</span>default <span class="token number">25</span><span class="token punctuation">)</span>
      --no-index        Don<span class="token string">&#39;t truncate output
      --no-trunc        Don&#39;</span>t truncate output
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>参数说明：</p><ul><li><code>-f, --filter filter</code>: 过滤输出的内容；</li><li><code>--limit int</code>：指定搜索内容展示个数;</li><li><code>--no-index</code>: 不截断输出内容；</li><li><code>--no-trunc</code>：不截断输出内容；</li></ul><p>举个例子🌰，比如想搜索 Stars 数超过 100 的 mysql 镜像：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> search <span class="token parameter variable">--filter</span><span class="token operator">=</span>stars<span class="token operator">=</span><span class="token number">100</span> mysql
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165700254456622" alt="Docker 搜索镜像"></p><h3 id="docker-下载镜像" tabindex="-1"><a class="header-anchor" href="#docker-下载镜像" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-download-image.html" target="_blank" rel="noopener noreferrer">Docker 下载镜像<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="拉取-下载镜像" tabindex="-1"><a class="header-anchor" href="#拉取-下载镜像" aria-hidden="true">#</a> 拉取&amp;下载镜像</h4><p>可以通过 <code>pull</code> 命令下载镜像, 命令如下：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker pull [IMAGE_NAME]:[TAG]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>参数说明：</p><ul><li><code>IMAGE_NAME</code>: 表示想要下载的镜像名称；</li><li><code>TAG</code>: 镜像的标签, 通常是镜像的版本号;</li></ul><p>总结一下：我们需要通过 “<strong>镜像 + 标签</strong>” 的方式来下载镜像。</p><blockquote><p>注意：您也可以不显式地指定 TAG, 它会默认下载 latest 标签，也就是下载仓库中最新版本的镜像。这里并不推荐您下载 latest 标签，因为该镜像的内容会跟踪镜像的最新版本，并随之变化，所以它是不稳定的。在生产环境中，可能会出现莫名其妙的 bug, 推荐您最好还是显示的指定具体的 TAG。</p></blockquote><p>实践一下，假设想要下载一个 Mysql 5.7 镜像，可以通过下面命令来下载：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> pull mysql:5.7
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>会看到控制台输出内容如下：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165648522762749" alt="Docker 下载镜像">Docker 下载镜像</p><p>当有 <strong>Downloaded</strong> 字符串输出的时候，说明下载成功了！！</p><blockquote><p>注意：由于官方 DockerHub 仓库服务器在国外，下载速度较慢，你需要配置国内的镜像加速器，配置教程点击下方链接：</p><p>https://www.quanxiaoha.com/docker/aliyun-docker-registry.html</p></blockquote><h4 id="验证镜像是否下载成功" tabindex="-1"><a class="header-anchor" href="#验证镜像是否下载成功" aria-hidden="true">#</a> 验证镜像是否下载成功</h4><p>运行如下命令：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> images
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165648541599314" alt="验证本地镜像是否存在">验证本地镜像是否存在</p><p>可以看到本地已经有了 <code>mysql:5.7</code> 的镜像，确实是下载成功了！</p><h4 id="pull-参数说明" tabindex="-1"><a class="header-anchor" href="#pull-参数说明" aria-hidden="true">#</a> PULL 参数说明</h4><p>命令行中输入：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> pull <span class="token parameter variable">--help</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>可以获取 <code>pull</code> 命令支持的参数：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token punctuation">[</span>root@iZbp1j8y1bab0djl9gdp33Z ~<span class="token punctuation">]</span><span class="token comment"># docker pull --help</span>

Usage:  <span class="token function">docker</span> pull <span class="token punctuation">[</span>OPTIONS<span class="token punctuation">]</span> NAME<span class="token punctuation">[</span>:TAG<span class="token operator">|</span>@DIGEST<span class="token punctuation">]</span>

Pull an image or a repository from a registry

Options:
  -a, --all-tags                Download all tagged images <span class="token keyword">in</span> the repository
      --disable-content-trust   Skip image verification <span class="token punctuation">(</span>default <span class="token boolean">true</span><span class="token punctuation">)</span>
      <span class="token parameter variable">--help</span>                    Print usage
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>参数说明：</p><ol><li><code>-a, --all-tags=true|false</code>: 是否获取仓库中所有镜像，默认为否；</li><li><code>--disable-content-trust</code>: 跳过镜像内容的校验，默认为 true;</li></ol><h3 id="docker-查看镜像信息" tabindex="-1"><a class="header-anchor" href="#docker-查看镜像信息" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-look-image.html" target="_blank" rel="noopener noreferrer">Docker 查看镜像信息<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="images-命令列出镜像" tabindex="-1"><a class="header-anchor" href="#images-命令列出镜像" aria-hidden="true">#</a> images 命令列出镜像</h4><p>通过使用如下两个命令，可以列出本地已下载的镜像：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> images
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>或：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> image <span class="token function">ls</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>如下图所示：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165648660235112" alt="Docker 查看镜像信息">Docker 查看镜像信息</p><p>红色标注的字段说明：</p><ul><li><strong>REPOSITORY</strong>: 来自于哪个仓库；</li><li><strong>TAG</strong>: 镜像的标签信息，比如 5.7、latest 表示镜像不同的版本；</li><li><strong>IMAGE ID</strong>: 镜像的 ID, 如果您看到两个 ID 完全相同，那么实际上，它们指向的是同一个镜像，只是标签名称不同罢了；</li><li><strong>CREATED</strong>: 镜像创建于什么时间；</li><li><strong>SIZE</strong>: 镜像的大小，优秀的镜像一般体积都比较小，小哈更倾向于轻量级的 alpine 版本镜像；</li></ul><h4 id="inspect-查看镜像详细信息" tabindex="-1"><a class="header-anchor" href="#inspect-查看镜像详细信息" aria-hidden="true">#</a> inspect 查看镜像详细信息</h4><p>通过 <code>docker inspect</code> 命令，可以获取镜像的更多详细信息，其中，包括创建者，各层 <code>layer</code> 的数字摘要等。</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> inspect mysql:5.7
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165648718485093" alt="Docker inspect 查看镜像详细信息"></p><p><code>docker inspect</code> 返回的是 <code>JSON</code> 格式的信息，如果您想获取其中指定的一项内容，可以通过 <code>-f</code> 来指定，如获取镜像大小：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> inspect <span class="token parameter variable">-f</span> <span class="token punctuation">{</span><span class="token punctuation">{</span><span class="token string">&quot;.Size&quot;</span><span class="token punctuation">}</span><span class="token punctuation">}</span> mysql:5.7
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165648740581628" alt="Docker inspect 查看镜像详细信息"></p><h4 id="history-查看镜像历史" tabindex="-1"><a class="header-anchor" href="#history-查看镜像历史" aria-hidden="true">#</a> history 查看镜像历史</h4><p>一个镜像是由多个层（layer）组成的，那么，我们要如何知道各个层的具体内容呢？</p><p>通过 <code>docker history</code> 命令，可以列出各个层（layer）的创建信息，以下是查看 <code>mysql:5.7</code> 的各层信息的命令：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> <span class="token function">history</span> mysql:5.7
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165648757597224" alt="Docker history 各层信息"></p><p>上面的输出信息中，为了美观，超出的都省略了，如果想要看具体信息，可以添加 <code>--no-trunc</code> 参数，命令如下：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> <span class="token function">history</span> --no-trunc mysql:5.7
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="docker-导出-导入镜像" tabindex="-1"><a class="header-anchor" href="#docker-导出-导入镜像" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-save-load-image.html" target="_blank" rel="noopener noreferrer">Docker 导出&amp;导入镜像<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="导出镜像" tabindex="-1"><a class="header-anchor" href="#导出镜像" aria-hidden="true">#</a> 导出镜像</h4><p>通过 <code>docker save</code> 命令可以导出 Docker 镜像。</p><p>举个例子🌰，比如想导出下图中的 Redis 镜像：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165700399037320" alt="docker 查看本地镜像"></p><p>执行命令如下：</p><div class="language-cmd line-numbers-mode" data-ext="cmd"><pre class="language-cmd"><code>docker save -o redis.tar redis:latest
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>执行成功后，即可在当前目录看到打包好的 tar 包了：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165700436365668" alt="Docker 导出文件"></p><p>可以看到 <code>redis.tar</code> 镜像文件已经生成。接下来，你可以复制它，分享给别人了！</p><h4 id="导入镜像" tabindex="-1"><a class="header-anchor" href="#导入镜像" aria-hidden="true">#</a> 导入镜像</h4><p>别人拿到了这个 <code>tar</code> 包后，要如何导入到本地的镜像库呢？</p><p>可以通过 <code>docker load</code> 命令导入镜像：</p><div class="language-cmd line-numbers-mode" data-ext="cmd"><pre class="language-cmd"><code>docker load -i redis.tar
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>或者：</p><div class="language-cmd line-numbers-mode" data-ext="cmd"><pre class="language-cmd"><code>docker load &lt; redis.tar
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>导入成功后，查看本地镜像，即可看到别人分享的镜像导入成功！怎么样，是不是很方便呢！</p><h3 id="docker-删除镜像" tabindex="-1"><a class="header-anchor" href="#docker-删除镜像" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-remove-image.html" target="_blank" rel="noopener noreferrer">Docker 删除镜像<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="通过标签删除镜像" tabindex="-1"><a class="header-anchor" href="#通过标签删除镜像" aria-hidden="true">#</a> 通过标签删除镜像</h4><p>以下两种命令均可删除镜像：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> rmi <span class="token punctuation">[</span>image<span class="token punctuation">]</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>或者：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> image <span class="token function">rm</span> <span class="token punctuation">[</span>image<span class="token punctuation">]</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>支持的参数如下：</p><ul><li><code>-f, -force</code>: 强制删除镜像，即便有容器引用该镜像；</li><li><code>-no-prune</code>: 不要删除未带标签的父镜像；</li></ul><p><img src="https://img.quanxiaoha.com/quanxiaoha/165641361745373" alt="Docker 查看镜像信息"></p><p>假设，我们想删除创建的 <code>redis</code> 镜像，命令如下：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> rmi redis:latest
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><blockquote><p>PS： 当有多个同名镜像存在时，想要删除指定镜像需带上 TAG。</p></blockquote><p><img src="https://img.quanxiaoha.com/quanxiaoha/165641372835974" alt="Docker 删除镜像"></p><p>从上图可以看到，我们已经删除了 <code>redis:latest</code> 镜像。</p><h4 id="通过-id-删除镜像" tabindex="-1"><a class="header-anchor" href="#通过-id-删除镜像" aria-hidden="true">#</a> 通过 ID 删除镜像</h4><p>除了通过标签名称来删除镜像，还可以通过镜像 ID 来删除镜像。</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165641403579736" alt="查看 Docker 镜像的 ID"></p><p>直接通过 ID 删除镜像，命令如下：</p><div class="language-bach line-numbers-mode" data-ext="bach"><pre class="language-bach"><code>docker rmi ee7cbd482336
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h4 id="清理镜像" tabindex="-1"><a class="header-anchor" href="#清理镜像" aria-hidden="true">#</a> 清理镜像</h4><p>在使用 Docker 一段时间后，系统一般都会残存一些临时的、没有被使用的镜像文件，可以通过以下命令进行清理：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">docker</span> image prune
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>它支持的子命令有：</p><ul><li><code>-a, --all</code>: 删除所有没有用的镜像，而不仅仅是临时文件；</li><li><code>-f, --force</code>：强制删除镜像文件，无需弹出提示确认；</li></ul><p>另外，执行完 <code>docker image prune</code> 命令后，还会告诉我们释放了多少存储空间！</p><h3 id="docker-上传镜像" tabindex="-1"><a class="header-anchor" href="#docker-上传镜像" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-upload-image.html" target="_blank" rel="noopener noreferrer">Docker 上传镜像<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="获取-docker-id" tabindex="-1"><a class="header-anchor" href="#获取-docker-id" aria-hidden="true">#</a> 获取 Docker ID</h4><p>首先，我们需要注册 <a href="https://hub.docker.com/" target="_blank" rel="noopener noreferrer">Docker Hub<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 账号。打开 Docker Hub 网址 <a href="https://hub.docker.com/" target="_blank" rel="noopener noreferrer">https://hub.docker.com<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> ，开始注册：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701240238053" alt="Docker Hub 注册账号"></p><p>填写您的 Docker ID (也就是账号)，以及密码，Email, 点击继续。</p><p>接下来，Docker Hub 会发送验证邮件，到您填写的邮箱当中：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701245439313" alt="Docker Hub 验证邮件">Docker Hub 验证邮件</p><p>点击验证即可，接下来，再次返回 Docker Hub 官网，用您刚刚注册的 Docker ID 和密码来登录账号！</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701251569658" alt="Docker Hub 登录页面"></p><h4 id="创建镜像仓库" tabindex="-1"><a class="header-anchor" href="#创建镜像仓库" aria-hidden="true">#</a> 创建镜像仓库</h4><p>登录成功后，会出现如下页面：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701256186488" alt="欢迎来到 Docker Hub"></p><p>选择创建一个镜像仓库：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701260693796" alt="创建 Python 仓库"></p><p>填写<strong>仓库名称</strong>、<strong>描述信息</strong>、<strong>是否公开后</strong>，点击创建。</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701265376347" alt="仓库镜像展示页"></p><p>我们看到，仓库已经创建成功了，但是里面还没有任何镜像，接下来开始上传镜像，到此新创建的仓库中。</p><h4 id="上传镜像" tabindex="-1"><a class="header-anchor" href="#上传镜像" aria-hidden="true">#</a> 上传镜像</h4><p>进入命令行，<strong>用我们刚刚获取的 Docker ID 以及密码登录</strong>，执行命令：</p><div class="language-cmd line-numbers-mode" data-ext="cmd"><pre class="language-cmd"><code>docker login
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701269090539" alt="命令行登录 Docker ID"></p><p>登录成功后，我们开始准备上传本地的 <code>python:3</code> 镜像：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701272871942" alt="python:3 镜像"></p><p>首先，我们对其打一个新的标签，<strong>前缀与我们新创建的 Docker ID 、仓库名保持一致</strong>:</p><div class="language-cmd line-numbers-mode" data-ext="cmd"><pre class="language-cmd"><code>docker tag python:3 weiwosuoai1991/python:3
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701278556536" alt="python:3 镜像打标签"></p><p>查看本地信息，可以看到，标签打成功了。接下开，开始上传！执行命令：</p><div class="language-cmd line-numbers-mode" data-ext="cmd"><pre class="language-cmd"><code>docker push weiwosuoai1991/python:3
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165701283325835" alt="上传 python:3 镜像"></p><p>上传成功！去 Docker Hub 官网，新创建的仓库的信息页面验证一下，是否真的成功了：</p><h2 id="docker-容器-1" tabindex="-1"><a class="header-anchor" href="#docker-容器-1" aria-hidden="true">#</a> Docker 容器</h2><h3 id="docker-启动容器" tabindex="-1"><a class="header-anchor" href="#docker-启动容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-run-container.html" target="_blank" rel="noopener noreferrer">Docker 启动容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="基于镜像新建容器并启动" tabindex="-1"><a class="header-anchor" href="#基于镜像新建容器并启动" aria-hidden="true">#</a> 基于镜像新建容器并启动</h4><p>通过如下命令来启动容器：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker run IMAGE:TAG
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>参数说明：</p><ul><li><code>IMAGE</code>: 镜像名称；</li><li><code>TAG</code>: 标签，镜像版本号；</li></ul><p>举个例子🌰，比如想启动一个 <code>ubuntu</code> 容器, 并通过终端输出 <code>Hello world</code>：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165675444666134" alt="docker 启动容器"></p><p>执行命令如下：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker run ubuntu:latest /bin/echo &#39;Hello world&#39;
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165675497278229" alt="docker 启动 ubuntu 容器并输出 hello world"></p><p>注意，上面这行命令运行容器，在输出 <code>Hello world</code> 后就会终止运行。如果想以交互的方式运行容器，执行如下命令：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker run -t -i ubuntu:latest /bin/bash
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165681989969425" alt="以交互的方式运行 docker 容器"></p><p>参数说明：</p><ul><li><code>-t</code>: 让 Docker 分配一个伪终端（pseudo-tty）并绑定到容器的标准输入上;</li><li><code>-i</code>: 让容器的标准输入保持打开;</li></ul><p>如此，就可以直接在终端执行命令了：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>root@c355025f2241:/# ls
bin  boot  dev  etc  home  lib  lib32  lib64  libx32  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@c355025f2241:/# date
Sun Jul  3 03:47:41 UTC 2022
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote><h4 id="_1-1-拓展知识-执行-docker-run-后-docker-都干了些啥" tabindex="-1"><a class="header-anchor" href="#_1-1-拓展知识-执行-docker-run-后-docker-都干了些啥" aria-hidden="true">#</a> 1.1 拓展知识：执行 <code>docker run</code> 后，Docker 都干了些啥？</h4></blockquote><ul><li>检查本地是否存在指定的镜像，不存在就从 <a href="https://www.quanxiaoha.com/docker/docker-run-container.html" target="_blank" rel="noopener noreferrer">registry<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 下载</li><li>利用镜像创建并启动一个容器</li><li>分配一个文件系统，并在只读的镜像层外面挂载一层可读写层</li><li>从宿主主机配置的网桥接口中桥接一个虚拟接口到容器中去</li><li>从地址池配置一个 ip 地址给容器</li><li>执行用户指定的应用程序</li><li>执行完毕后容器被终止</li></ul><blockquote><h3 id="_1-2-以-daemon-守护态方式运行容器" tabindex="-1"><a class="header-anchor" href="#_1-2-以-daemon-守护态方式运行容器" aria-hidden="true">#</a> 1.2 以 daemon 守护态方式运行容器</h3></blockquote><p>实际应用中，需要让容器以后台的方式运行，以此保证一个稳定的服务。</p><p>运行容器时添加 <code>-d</code> 参数可以让容器以后台的方式运行，例如启动一个 Ubuntu 后台容器，并每隔一秒打印 <code>Hello world</code>，命令如下:</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker run -d ubuntu:latest /bin/sh -c &quot;while true; do echo hello world; sleep 1; done&quot;
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>执行成功后，会返回一个容器 ID。</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165682439504761" alt="docker 以后台的方式运行容器">docker 以后台的方式运行容器</p><p>后台运行的容器可以通过 <code>docker logs</code> 命令来查看日志：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container logs [container ID or NAMES]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h4 id="启动终止状态的容器" tabindex="-1"><a class="header-anchor" href="#启动终止状态的容器" aria-hidden="true">#</a> 启动终止状态的容器</h4><p>执行如下命令，可以将已经终止 （<code>exited</code>）运行的容器重启。</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container start [container ID or NAMES]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>测试一波好不好使，先通过 <code>docker ps</code> 命令获取正在运行的容器:</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165682272506621" alt="获取 docker 容器 id"></p><p>小哈本地有个 Redis 容器正在运行，先拿到容器 ID 或者容器名称，执行 <code>docker stop</code> 停止它后，再执行 <code>docker container start</code> 命令重启这个 Redis 容器 :</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165682304261142" alt="重启 redis 容器"></p><p>可以看到，成功重启了一个终止状态的容器。</p><h3 id="docker-查看容器" tabindex="-1"><a class="header-anchor" href="#docker-查看容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-ps-container.html" target="_blank" rel="noopener noreferrer">Docker 查看容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="查看正在运行中、停止运行的容器" tabindex="-1"><a class="header-anchor" href="#查看正在运行中、停止运行的容器" aria-hidden="true">#</a> 查看正在运行中、停止运行的容器</h4><ul><li><code>docker ps</code> : 查看正在运行中的容器；</li><li><code>docker ps -a</code> : 查看所有容器，包括运行中的、已经停止运行的容器。</li></ul><p><img src="https://img.quanxiaoha.com/quanxiaoha/165692898193876" alt="docker 查看容器">docker 查看容器</p><p>返回字段说明：</p><ul><li><strong>CONTAINER ID</strong> : 容器 ID；</li><li><strong>IMAGE</strong> : 创建容器时使用的镜像；</li><li><strong>COMMAND</strong> : 容器最后运行的命令；</li><li><strong>CREATED</strong> : 容器创建时间；</li><li><strong>STATUS</strong> : 容器状态；</li><li><strong>PORTS</strong> : 端口信息；</li><li><strong>NAMES</strong> : 容器名：和容器 ID 一样，可以标识容器的唯一性，同一台宿主机上不允许有同名容器存在，否则会冲突；</li></ul><h4 id="拓展命令" tabindex="-1"><a class="header-anchor" href="#拓展命令" aria-hidden="true">#</a> 拓展命令</h4><ul><li><code>docker ps -l</code> : 查看最新创建的容器，注意，只列出最后创建的容器。</li><li><code>docker ps -n=2</code>: <code>-n=2</code> 指定列出最新创建的 2 个容器。</li></ul><h3 id="docker-进入容器" tabindex="-1"><a class="header-anchor" href="#docker-进入容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-exec-container.html" target="_blank" rel="noopener noreferrer">Docker 进入容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="exec-命令-推荐" tabindex="-1"><a class="header-anchor" href="#exec-命令-推荐" aria-hidden="true">#</a> exec 命令（推荐）</h4><p>Docker 在 1.3.X 版本后开始支持 <code>exec</code> 命令进入容器，命令如下：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker exec -it [container ID or NAMES] 
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>举个例子🌰，比如想进入到本地的 Redis 容器中：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165685069315125" alt="Docker 准备进入 redis 容器"></p><p>可以通过容器 ID 或者名称进入容器：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker exec -it redis /bin/bash
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165685112371724" alt="docker 通过 exec 命令进入到容器"></p><p>要想退出容器，只需键入 <code>exit</code> 命令回车即可：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>(base) ➜  ~ docker exec -it redis /bin/bash
root@023d93457910:/data#
root@023d93457910:/data#
root@023d93457910:/data#
root@023d93457910:/data# exit
exit
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote><p><strong>注意：<code>exec</code> 命令和下面 <code>attach</code> 命令的区别在于，当使用 <code>exit</code> 退出容器时，不会导致容器停止。</strong></p></blockquote><h4 id="attach-命令" tabindex="-1"><a class="header-anchor" href="#attach-命令" aria-hidden="true">#</a> attach 命令</h4><p>执行命令格式如下：注意：这种方式在执行 <code>exit</code> 命令退出容器时，会导致容器停止运行</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker attach [container ID or NAMES] 
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="docker-停止容器" tabindex="-1"><a class="header-anchor" href="#docker-停止容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-stop-container.html" target="_blank" rel="noopener noreferrer">Docker 停止容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="stop-优雅模式" tabindex="-1"><a class="header-anchor" href="#stop-优雅模式" aria-hidden="true">#</a> stop 优雅模式</h4><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container stop [container ID or NAMES]
# 简写模式（可省略关键字 container ）
docker stop [container ID or NAMES]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>举个例子🌰，比如想要停止下图中的 Ubuntu 容器：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165683843779847" alt="docker 停止关闭 ubuntu 容器">docker 停止关闭 ubuntu 容器</p><p>通过容器 ID 或者容器名称都可以停止容器，命令如下：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># 通过容器 ID 关闭容器
docker stop 4e6fc78cc0c4
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="kill-强制模式" tabindex="-1"><a class="header-anchor" href="#kill-强制模式" aria-hidden="true">#</a> kill 强制模式</h4><p><code>kill</code> 命令强制关闭容器：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container kill [container ID or NAMES]
# 简写模式（可省略关键字 container ）
docker kill [container ID or NAMES]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote><p>对于交互形式运行的容器如何关闭？</p></blockquote><p>对于<a href="https://www.quanxiaoha.com/docker/docker-run-container.html" target="_blank" rel="noopener noreferrer">《Docker 启动容器》<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 小节中说到的交互形式运行的容器，可以通过输入 <code>exit</code> 或者 <code>Ctrl+d</code> 退出容器。</p><blockquote><p>查看已经停止运行的容器</p></blockquote><p>执行如下命令，可以看到那些已经停止运行的容器：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container ls -a
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><img src="https://img.quanxiaoha.com/quanxiaoha/165683898636155" alt="查看 docker 已经停止运行的容器"></p><p>想要重启已经停止运行的容器，命令如下：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container start [container ID or NAMES]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>另外，<code>docker container restart</code> 命令会将一个已经运行中的容器重新启动。</p><h3 id="docker-重启容器" tabindex="-1"><a class="header-anchor" href="#docker-重启容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-restart-container.html" target="_blank" rel="noopener noreferrer">Docker 重启容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><p>执行如下命令重启 Docker 容器：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># 不管容器是否启动，直接重启
docker restart [container ID or NAMES]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>举个例子🌰，比如想要重启下面的 Redis 容器：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165693588723614" alt="docker 重启 redis 容器">docker 重启 redis 容器</p><p>执行如下命令即可：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># 通过容器 ID 或者名称都可以
docker restart redis
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="t-参数" tabindex="-1"><a class="header-anchor" href="#t-参数" aria-hidden="true">#</a> -t 参数</h4><p><code>-t</code> : 设置关闭容器的限制时间，若超时未能关闭，则使用 <code>kill</code> 命令强制关闭，默认值为 10s，这个时间用于容器保存自己的状态。</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># 限时 5s 关闭 redis 容器，然后重启
docker restart -t=5 redis
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="docker-导出-导入容器" tabindex="-1"><a class="header-anchor" href="#docker-导出-导入容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-export-import-container.html" target="_blank" rel="noopener noreferrer">Docker 导出&amp;导入容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="导出容器" tabindex="-1"><a class="header-anchor" href="#导出容器" aria-hidden="true">#</a> 导出容器</h4><p>使用 <code>docker export</code> 命令可以导出容器，比如想导出下面的 Redis 容器：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165698500345714" alt="查看本地的 docker 容器"></p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker export 9e8d11aeef0c &gt; redis.tar
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>导出的 <code>tar</code> 包快照存于当前目录下。</p><h4 id="导入容器快照" tabindex="-1"><a class="header-anchor" href="#导入容器快照" aria-hidden="true">#</a> 导入容器快照</h4><p>使用 <code>docker import</code> 命令可以将快照导入为镜像，例如：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>cat redis.tar | docker import - test/redis:v1.0
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>导入成功后，就可以看到新生成的镜像了：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165698582517092" alt="docker 导出容器">docker 导出容器</p><p>除了通过快照的方式导入容器，还可以通过指定 URL 或者某个目录来导入，例如：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker import http://example.com/exampleimage.tgz example/imagerepo
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="docker-删除容器" tabindex="-1"><a class="header-anchor" href="#docker-删除容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-delete-container.html" target="_blank" rel="noopener noreferrer">Docker 删除容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h4 id="删除容器" tabindex="-1"><a class="header-anchor" href="#删除容器" aria-hidden="true">#</a> 删除容器</h4><p>执行如下命令可以删除一个已经<a href="https://www.quanxiaoha.com/docker/docker-stop-container.html" target="_blank" rel="noopener noreferrer">停止运行的容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> ：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container rm [container ID or NAMES]
# 简写模式（可省略关键字 container ）
docker rm [container ID or NAMES]
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>举个例子🌰，比如想要删除下面的 Redis 容器：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165685534557469" alt="docker 查看本地容器"></p><p>执行如下命令即可：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># 通过容器 ID 删除
docker rm 023d93457910
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="强制删除容器" tabindex="-1"><a class="header-anchor" href="#强制删除容器" aria-hidden="true">#</a> 强制删除容器</h4><p>添加 <code>-f</code> 参数可强制删除一个正在运行的容器：</p><p><img src="https://img.quanxiaoha.com/quanxiaoha/165685566467565" alt="docker 查看正在运行的容器"></p><p>如图示，强制删除这个 Redis 容器：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code># 通过容器 ID 强制删除容器
docker rm -f 207aaf2e3384
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="删除所有停止运行容器" tabindex="-1"><a class="header-anchor" href="#删除所有停止运行容器" aria-hidden="true">#</a> 删除所有停止运行容器</h4><p>如何一次性删除所有已经停止的容器呢？</p><p>用 <code>docker container ls -a</code> 命令可以查看所有已经创建的包括停止运行的容器，如果数量太多要一个个删除会很麻烦，执行如下命令即可删除掉所有已经停止运行的容器：</p><div class="language-text line-numbers-mode" data-ext="text"><pre class="language-text"><code>docker container prune
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="docker-功能" tabindex="-1"><a class="header-anchor" href="#docker-功能" aria-hidden="true">#</a> | -- Docker 功能</h2><h2 id="docker-数据管理" tabindex="-1"><a class="header-anchor" href="#docker-数据管理" aria-hidden="true">#</a> Docker 数据管理</h2><h3 id="数据卷" tabindex="-1"><a class="header-anchor" href="#数据卷" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-volume.html" target="_blank" rel="noopener noreferrer">数据卷<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="数据卷容器" tabindex="-1"><a class="header-anchor" href="#数据卷容器" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-volume-container.html" target="_blank" rel="noopener noreferrer">数据卷容器<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="备份、恢复、迁移数据卷" tabindex="-1"><a class="header-anchor" href="#备份、恢复、迁移数据卷" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-volume-backup.html" target="_blank" rel="noopener noreferrer">备份、恢复、迁移数据卷<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h2 id="dockerfile" tabindex="-1"><a class="header-anchor" href="#dockerfile" aria-hidden="true">#</a> Dockerfile</h2><h3 id="dockerfile-1" tabindex="-1"><a class="header-anchor" href="#dockerfile-1" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/what-is-dockerfile.html" target="_blank" rel="noopener noreferrer">Dockerfile<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="制作镜像" tabindex="-1"><a class="header-anchor" href="#制作镜像" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/dockerfile-build-image.html" target="_blank" rel="noopener noreferrer">制作镜像<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="常用指令汇总" tabindex="-1"><a class="header-anchor" href="#常用指令汇总" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/dockerfile-commands.html" target="_blank" rel="noopener noreferrer">常用指令汇总<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h2 id="docker-compose" tabindex="-1"><a class="header-anchor" href="#docker-compose" aria-hidden="true">#</a> Docker Compose</h2><h3 id="docker-compose-1" tabindex="-1"><a class="header-anchor" href="#docker-compose-1" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/what-is-docker-compose.html" target="_blank" rel="noopener noreferrer">Docker Compose <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="安装与卸载" tabindex="-1"><a class="header-anchor" href="#安装与卸载" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-install-compose.html" target="_blank" rel="noopener noreferrer">安装与卸载<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="实战-web-服务" tabindex="-1"><a class="header-anchor" href="#实战-web-服务" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-compose-example.html" target="_blank" rel="noopener noreferrer">实战 web 服务<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="命令大全" tabindex="-1"><a class="header-anchor" href="#命令大全" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-compose-commands.html" target="_blank" rel="noopener noreferrer">命令大全<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h2 id="docker-常见环境安装" tabindex="-1"><a class="header-anchor" href="#docker-常见环境安装" aria-hidden="true">#</a> Docker 常见环境安装</h2><h3 id="安装-redis" tabindex="-1"><a class="header-anchor" href="#安装-redis" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-install-redis.html" target="_blank" rel="noopener noreferrer">安装 Redis<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="安装-mysql" tabindex="-1"><a class="header-anchor" href="#安装-mysql" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-install-mysql.html" target="_blank" rel="noopener noreferrer">安装 MySQL<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="安装-nginx" tabindex="-1"><a class="header-anchor" href="#安装-nginx" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-install-nginx.html" target="_blank" rel="noopener noreferrer">安装 Nginx<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h3 id="nginx-安装-ssl-证书" tabindex="-1"><a class="header-anchor" href="#nginx-安装-ssl-证书" aria-hidden="true">#</a> <a href="https://www.quanxiaoha.com/docker/docker-nginx-install-ssl.html" target="_blank" rel="noopener noreferrer">Nginx 安装 SSL 证书<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></h3><h2 id="docker-速查手册" tabindex="-1"><a class="header-anchor" href="#docker-速查手册" aria-hidden="true">#</a> Docker 速查手册</h2><blockquote><p>Docker 常用命令导图：<a href="https://www.quanxiaoha.com/docker/docker-total-cmd.html" target="_blank" rel="noopener noreferrer">Docker 常用命令大全<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></p></blockquote><p><img src="https://img.quanxiaoha.com/quanxiaoha/166255773325089" alt="Docker 常用命令导图"></p><h3 id="基本命令" tabindex="-1"><a class="header-anchor" href="#基本命令" aria-hidden="true">#</a> 基本命令</h3><table><thead><tr><th>命令</th><th>说明</th></tr></thead><tbody><tr><td><a href="https://www.quanxiaoha.com/docker/docker-info.html" target="_blank" rel="noopener noreferrer">docker info<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></td><td>检查当前容器的安装情况（包括镜像数、容器书、多少个物理机节点）</td></tr><tr><td>docker version</td><td>查看当前安装的 Docker 的版本信息</td></tr></tbody></table><h3 id="容器生命周期相关命令" tabindex="-1"><a class="header-anchor" href="#容器生命周期相关命令" aria-hidden="true">#</a> 容器生命周期相关命令</h3><table><thead><tr><th>命令</th><th>说明</th></tr></thead><tbody><tr><td><a href="https://www.quanxiaoha.com/docker/docker-run-container.html" target="_blank" rel="noopener noreferrer">docker run<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> -d -p x:x --name xxx 镜像id</td><td>以后台方式运行容器</td></tr><tr><td>docker create --name xxx nginx:latest</td><td>创建一个新的容器，但是不启动</td></tr><tr><td>docker start/stop/restart</td><td>启动\停止\重启一个容器</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-kill.html" target="_blank" rel="noopener noreferrer">docker kill<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> 容器id</td><td>终止一个运行中的容器，kill 不管是否同意，直接强制终止</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-remove-image.html" target="_blank" rel="noopener noreferrer">docker rm<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> -vf 容器id</td><td>删除一个或者多个容器</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-exec-container.html" target="_blank" rel="noopener noreferrer">docker exec<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> -it id bash</td><td>进入到容器内部</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-attach.html" target="_blank" rel="noopener noreferrer">docker attach<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></td><td>进入到容器内部</td></tr></tbody></table><h3 id="容器操作相关命令" tabindex="-1"><a class="header-anchor" href="#容器操作相关命令" aria-hidden="true">#</a> 容器操作相关命令</h3><table><thead><tr><th>说明</th><th>命令</th></tr></thead><tbody><tr><td><a href="https://www.quanxiaoha.com/docker/docker-ps.html" target="_blank" rel="noopener noreferrer">docker ps<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> -a | grep xxxx</td><td>显示某一个组件 XXX 的容器列表</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-look-image.html" target="_blank" rel="noopener noreferrer">docker inspect<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> id</td><td>获取容器或者镜像的元数据</td></tr><tr><td>docker top id</td><td>查看容器中运行的进程信息</td></tr><tr><td>docker stats id</td><td>实时显示容器资源的使用统计</td></tr><tr><td>docker events</td><td>从服务器获取实时事件</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-logs.html" target="_blank" rel="noopener noreferrer">docker logs<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> id</td><td>查看容器内的标准日志输出</td></tr><tr><td>docker port id</td><td>列出指定容器的端口映射</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-cp.html" target="_blank" rel="noopener noreferrer">docker cp<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> ./t.txt id:/root/</td><td>将宿主机当前目录下的 t.txt 复制到 id 容器中的 root 目录下</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-diff.html" target="_blank" rel="noopener noreferrer">docker diff<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> id</td><td>列出该容器自创建以来，容器内部文件的变化</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-commit.html" target="_blank" rel="noopener noreferrer">docker commit<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> -m &quot;comment&quot; -a &quot;authon&quot; 容器id repository:tag</td><td>将指定容器打包成一个本地镜像</td></tr><tr><td>docker update --memory=16G</td><td>修改容器运行中的配置，即时生效无需配置</td></tr></tbody></table><h3 id="本地镜像管理相关命令" tabindex="-1"><a class="header-anchor" href="#本地镜像管理相关命令" aria-hidden="true">#</a> 本地镜像管理相关命令</h3><table><thead><tr><th>命令</th><th>说明</th></tr></thead><tbody><tr><td><a href="https://www.quanxiaoha.com/docker/docker-images.html" target="_blank" rel="noopener noreferrer">docker images<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></td><td>列出本地宿主机上的所有镜像</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-history.html" target="_blank" rel="noopener noreferrer">docker history<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> id</td><td>查看指定镜像的分层结构以及创建历史</td></tr><tr><td>docker image inspect id</td><td>查看镜像的元数据信息</td></tr><tr><td>docker rmi id</td><td>根据镜像 id 删除镜像</td></tr><tr><td>docker tag image-name:tag</td><td>给指定镜像增加 tag</td></tr><tr><td>docekr build -t tag .</td><td>通过当前目目录下的 Dockerfile 来构建一个标签为 tag 的镜像</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-export.html" target="_blank" rel="noopener noreferrer">docker export<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> -o xxx.tar id</td><td>将镜像打包成文件</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-import.html" target="_blank" rel="noopener noreferrer">docker import<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> xxx.tar name</td><td>从归档文件中创建镜像</td></tr><tr><td>docker save -o xxx.tat id</td><td>将指定镜像保存为归档文件</td></tr><tr><td>docker load --input xxx.tar</td><td>用于将 docker save 生成的归档文件还原成镜像</td></tr></tbody></table><h3 id="镜像仓库相关命令" tabindex="-1"><a class="header-anchor" href="#镜像仓库相关命令" aria-hidden="true">#</a> 镜像仓库相关命令</h3><table><thead><tr><th>命令</th><th>说明</th></tr></thead><tbody><tr><td>docker loging -u xxx -p xxx</td><td>登录一个 docker 镜像仓库，如果未指定镜像仓库地址，则默认为Docker Hub镜像仓库</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-logout.html" target="_blank" rel="noopener noreferrer">docker logout<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a></td><td>退出登录的镜像仓库</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-pull.html" target="_blank" rel="noopener noreferrer">docker pull<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> nginx</td><td>从默认的 Docker hub 上拉取 nginx 镜像</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-push.html" target="_blank" rel="noopener noreferrer">docker push<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> image_name</td><td>将本地镜像上传到镜像仓库（注意需要先登录）</td></tr><tr><td><a href="https://www.quanxiaoha.com/docker/docker-search.html" target="_blank" rel="noopener noreferrer">docker search<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> xxx</td><td>从默认的 Docker Hub 中搜索指定的镜像</td></tr></tbody></table><h3 id="参数命令" tabindex="-1"><a class="header-anchor" href="#参数命令" aria-hidden="true">#</a> 参数命令</h3><p>以下汇总 <code>docker run</code> 命令支持的相关参数：</p><h3 id="容器运行相关参数" tabindex="-1"><a class="header-anchor" href="#容器运行相关参数" aria-hidden="true">#</a> 容器运行相关参数</h3><table><thead><tr><th>参数</th><th>说明</th></tr></thead><tbody><tr><td>-a,--attach=[]</td><td>是否绑定到标准输入、输出、和错误.</td></tr><tr><td>-d,--detach=true|false</td><td>是否在后台运行，默认为 false</td></tr><tr><td>--detach-keys=&quot;&quot;</td><td>从attach模式退出的快捷键，默认是 Ctrl+P</td></tr><tr><td>--entrypoint=&quot;&quot;</td><td>镜像存在入口命令时覆盖新的命令.</td></tr><tr><td>-expost=[]</td><td>暴露出来的镜像端口</td></tr><tr><td>--group-add=[]</td><td>运行容器的用户组</td></tr><tr><td>-i</td><td>保持标准输入打开</td></tr><tr><td>--ipc=&quot;&quot;</td><td>容器 IP 命名空间</td></tr><tr><td>--isolation=&quot;default&quot;</td><td>容器使用的隔离机制</td></tr><tr><td>--log-driver=&quot;&quot;</td><td>指定容器的日志驱动类型</td></tr><tr><td>--log-opy=[]</td><td>传递给日志驱动的选项</td></tr><tr><td>--net=&quot;bridge&quot;</td><td>指定容器的网络模式</td></tr><tr><td>--net-alias=[]</td><td>容器在网络中的别名</td></tr><tr><td>--volume=[=[HOST-DIR]:]CONTAINER-DIR:[:OPTIONS]]</td><td>挂载宿主机上的数据卷到容器内</td></tr><tr><td>--volume-driver=&quot;&quot;</td><td>挂载数据卷的驱动类型.</td></tr><tr><td>--volumes-from=[]</td><td>其他容器挂载数据卷</td></tr></tbody></table><h3 id="容器环境配置相关参数" tabindex="-1"><a class="header-anchor" href="#容器环境配置相关参数" aria-hidden="true">#</a> 容器环境配置相关参数</h3><table><thead><tr><th>参数</th><th>说明</th></tr></thead><tbody><tr><td>--add-host=[]</td><td>在容器内添加一个宿主机名到 IP 地址的映射关系，修改 HOST 文件</td></tr><tr><td>--device=[]</td><td>映射物理机上的设备到容器</td></tr><tr><td>--dns-search=[]</td><td>指定容器 DNS 搜索域</td></tr><tr><td>--dns-opt=[]</td><td>自定义的 DNS 选项</td></tr><tr><td>--dns=[]</td><td>自定义的 DNS 服务器</td></tr><tr><td>-e,-env=[]</td><td>指定容器内的环境变量</td></tr><tr><td>-env-file=[]</td><td>从文件中读取环境变量到容器内</td></tr><tr><td>-h,--hostname=&quot;&quot;</td><td>指定容器中的主机名</td></tr><tr><td>--ip=&quot;&quot;</td><td>指定容器内 ip4 的地址</td></tr><tr><td>--ip6=&quot;&quot;</td><td>指定容器内 ip6 的地址</td></tr><tr><td>--link=[id]</td><td>连接到其他容器，不需要其他容器暴露端口</td></tr><tr><td>--name==&quot;&quot;</td><td>指定容器的别名</td></tr></tbody></table><h3 id="cpu-相关参数" tabindex="-1"><a class="header-anchor" href="#cpu-相关参数" aria-hidden="true">#</a> CPU 相关参数</h3><table><thead><tr><th>参数</th><th>说明</th></tr></thead><tbody><tr><td>--cpu-shares=0</td><td>允许容器使用 CPU 资源的相对权重，默认一个容器能用满一个 CPU，用于设置多个容器竞争 CPU 时，各个容器相对能分配到 CPU 时间占比</td></tr><tr><td>--cpu-period=0</td><td>限制容器在 CFS 调度下 CPU 占用的时间片，用于绝对设置容器能使用的 CPU 时间</td></tr><tr><td>--cpu-quota=0</td><td>限制容器在 CFS 调度器下的 CPU 配额，用于绝对设置容器能使用 CPU 的时间</td></tr><tr><td>--cpuset-cpus=&quot;&quot;</td><td>限制容器能使用那些 cpu 核数</td></tr><tr><td>--cpuset-mems=&quot;&quot;</td><td>NUMA 架构下使用那些核心内存</td></tr></tbody></table><h3 id="内存资源相关参数" tabindex="-1"><a class="header-anchor" href="#内存资源相关参数" aria-hidden="true">#</a> 内存资源相关参数</h3><table><thead><tr><th>参数</th><th>说明</th></tr></thead><tbody><tr><td>--kernel-memory=&quot;&quot;</td><td>限制容器使用内核的内存大小</td></tr><tr><td>-m,--memory=&quot;&quot;</td><td>限制容器内应用使用内存的大小</td></tr><tr><td>--memory-reservation=&quot;&quot;</td><td>当系统中内存过小时，容器会被强制限制内存到给定值默认情况下等于内存限制值</td></tr><tr><td>--memory-swap=&quot;LIMIT&quot;</td><td>限制容器使用内存和交换分区的大小</td></tr><tr><td>--oom-kill-disable=true</td><td>内存耗尽时是否终止容器</td></tr><tr><td>--oom-score-adj=&quot;&quot;</td><td>调整容器的内存耗尽参数</td></tr><tr><td>--memory-swappiness=&quot;0-100&quot;</td><td>调整容器的内存交换分区参数</td></tr></tbody></table><h3 id="容器磁盘-io-控制相关参数" tabindex="-1"><a class="header-anchor" href="#容器磁盘-io-控制相关参数" aria-hidden="true">#</a> 容器磁盘 IO 控制相关参数</h3><table><thead><tr><th>参数</th><th>说明</th></tr></thead><tbody><tr><td>--device-read-bps</td><td>限制此设备上的读速率</td></tr><tr><td>--device-read-iops</td><td>通过每秒读 IO 次数限制指定设备的读速率</td></tr><tr><td>--device-write-bps</td><td>限制此设备的写速率</td></tr><tr><td>--device-write-iops</td><td>通过每秒写 IO 次数限制指定设备的写速率</td></tr><tr><td>--blkio-weight</td><td>容器默认磁盘 IO 的加权值</td></tr><tr><td>--blkio-weight-device</td><td>针对特定设备的 IO 加权控制</td></tr></tbody></table></div></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="xicon-container left meta-item-label"><!--[--><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="xicon-icon" style="width:20px;height:20px;font-size:20px;color:inherit;"><path d="M26 4h-4V2h-2v2h-8V2h-2v2H6c-1.1 0-2 .9-2 2v20c0 1.1.9 2 2 2h20c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 22H6V12h20v14zm0-16H6V6h4v2h2V6h8v2h2V6h4v4z" fill="currentColor"></path></svg><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Last Updated 2023-09-12 07:31:46<!--]--></span></span></div></footer><!----><!----></main><!--]--><div class="page-catalog-container"><h5 class="tip">文章层级目录</h5><ul><!--[--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-基础概念" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 基础概念"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 基础概念<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-镜像" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 镜像<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-仓库" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 仓库"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 仓库<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-环境安装" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="| -- Docker 环境安装"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->| -- Docker 环境安装<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#windows-安装-docker" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Windows 安装 Docker"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Windows 安装 Docker<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#安装-docker-desktop" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="安装 Docker Desktop"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->安装 Docker Desktop<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#安装中你可能的问题" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="安装中你可能的问题"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->安装中你可能的问题<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#查看当前-docker-版本" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="查看当前 Docker 版本"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->查看当前 Docker 版本<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#验证-docker-desktop-正常" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="验证 Docker Desktop 正常"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->验证 Docker Desktop 正常<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#centos-安装-docker" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="CentOS 安装 Docker"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->CentOS 安装 Docker<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-操作命令" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="| -- Docker 操作命令"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->| -- Docker 操作命令<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-镜像-1" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 镜像<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-搜索镜像" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 搜索镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 搜索镜像<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-下载镜像" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 下载镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 下载镜像<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-查看镜像信息" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 查看镜像信息"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 查看镜像信息<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-导出-导入镜像" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 导出&amp;导入镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 导出&amp;导入镜像<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-删除镜像" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 删除镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 删除镜像<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-上传镜像" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 上传镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 上传镜像<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-容器-1" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 容器<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-启动容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 启动容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 启动容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-查看容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 查看容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 查看容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-进入容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 进入容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 进入容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-停止容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 停止容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 停止容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-重启容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 重启容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 重启容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-导出-导入容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 导出&amp;导入容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 导出&amp;导入容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-删除容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 删除容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 删除容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-功能" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="| -- Docker 功能"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->| -- Docker 功能<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-数据管理" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 数据管理"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 数据管理<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#数据卷" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="数据卷"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->数据卷<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#数据卷容器" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="数据卷容器"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->数据卷容器<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#备份、恢复、迁移数据卷" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="备份、恢复、迁移数据卷"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->备份、恢复、迁移数据卷<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#dockerfile" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Dockerfile"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Dockerfile<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#dockerfile-1" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Dockerfile"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Dockerfile<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#制作镜像" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="制作镜像"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->制作镜像<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#常用指令汇总" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="常用指令汇总"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->常用指令汇总<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-compose" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker Compose"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker Compose<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-compose-1" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker Compose"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker Compose<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#安装与卸载" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="安装与卸载"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->安装与卸载<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#实战-web-服务" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="实战 web 服务"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->实战 web 服务<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#命令大全" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="命令大全"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->命令大全<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-常见环境安装" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 常见环境安装"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 常见环境安装<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#安装-redis" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="安装 Redis"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->安装 Redis<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#安装-mysql" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="安装 MySQL"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->安装 MySQL<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#安装-nginx" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="安装 Nginx"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->安装 Nginx<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#nginx-安装-ssl-证书" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Nginx 安装 SSL 证书"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Nginx 安装 SSL 证书<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--[--><li class="page-catalog-menu-depth_2"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#docker-速查手册" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="Docker 速查手册"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->Docker 速查手册<!--]--></span></span><!--[--><!--]--></a></li><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#基本命令" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="基本命令"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->基本命令<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#容器生命周期相关命令" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="容器生命周期相关命令"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->容器生命周期相关命令<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#容器操作相关命令" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="容器操作相关命令"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->容器操作相关命令<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#本地镜像管理相关命令" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="本地镜像管理相关命令"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->本地镜像管理相关命令<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#镜像仓库相关命令" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="镜像仓库相关命令"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->镜像仓库相关命令<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#参数命令" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="参数命令"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->参数命令<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#容器运行相关参数" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="容器运行相关参数"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->容器运行相关参数<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#容器环境配置相关参数" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="容器环境配置相关参数"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->容器环境配置相关参数<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#cpu-相关参数" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="CPU 相关参数"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->CPU 相关参数<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#内存资源相关参数" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="内存资源相关参数"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->内存资源相关参数<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--[--><li class="page-catalog-menu-depth_3"><a aria-current="page" href="/blogs/GongZuo/Linux/Docker.html#容器磁盘-io-控制相关参数" class="router-link-active router-link-exact-active link page-catalog-item" aria-label="容器磁盘 IO 控制相关参数"><!--[--><!--]--><span class="xicon-container left"><!--[--><!----><!--]--><span class="xicon-content" style="color:inherit;font-size:14px;"><!--[-->容器磁盘 IO 控制相关参数<!--]--></span></span><!--[--><!--]--></a></li><!--]--><!--]--><!--]--></ul></div></div></div></div><!----><!----><!--]--></div>
    <script type="module" src="/assets/app-8a43a0f0.js" defer></script>
  </body>
</html>
